
Type Main_Graphics


	Field GFX : TGraphics
	Field GFX_Driver : TGraphicsDriver
	Field width : Int = 800, height : Int = 600, depth : Int = 0,hertz : Int = 60, flags : Int = GRAPHICS_BACKBUFFER
	
	Method New()
	
		GFX_Driver = D3D9Max2DDriver()
	
	End Method
	
	
	Method UseDriver(Driver : TGraphicsDriver)
		
		GFX_Driver = Driver
		SetGraphicsDriver( GFX_Driver,GRAPHICS_BACKBUFFER )
		 
		
		
	End Method

	
	Method Set()
	
		If GFX Then
			CloseGraphics( GFX )
		EndIf
		GFX = CreateGraphics( width,height,depth,hertz,flags )
		SetGraphics( GFX )
	End Method

End Type 

